Skip to content

fix(streamable-http): reject duplicate request IDs - #2756

Closed
Epochex wants to merge 3 commits into
modelcontextprotocol:mainfrom
Epochex:fix/2655-duplicate-request-id
Closed

Epochex wants to merge 3 commits into
modelcontextprotocol:mainfrom
Epochex:fix/2655-duplicate-request-id

Conversation

@Epochex

@Epochex Epochex commented Jun 1, 2026

Copy link
Copy Markdown

Fixes #2655.

When a Streamable HTTP session receives a second JSON-RPC request with an id that is already in-flight, the transport used to overwrite the per-id stream slot, leaving the first request hanging until client timeout.

This change rejects the duplicate with HTTP 409 + JSON-RPC error (preserving the offending id) and leaves the original request untouched.

Tests:

  • uv run --frozen pytest tests/issues/test_2655_streamable_http_duplicate_request_id.py
  • uv run --frozen pytest tests/server/test_streamable_http_manager.py

@Kludex

Kludex commented Jun 25, 2026

Copy link
Copy Markdown
Member

You've opened a duplicated pull request, please search opened PRs before creating new ones. Duplicated from #2657.

@Kludex Kludex closed this Jun 25, 2026
@modelcontextprotocol modelcontextprotocol locked as resolved and limited conversation to collaborators Jun 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Streamable HTTP server silently drops in-flight request when client reuses a JSON-RPC id

2 participants